#ifndef sysInit_H
#define sysInit_H

#define MODEL_NUM 4
#define JUMPTYPE 15

#ifdef sysInit_Variable
#define sysInit_Extern
























#ifdef JUMP_SELECT
/* HEAT1, HEAT2, HEAT3, HEAT4, HEAT5, HEAT6, HEAT7, COOL1, COOL2, COOL3, COOL4, COOL5, COOL6, COOL7 */
const U16 fanSpTab[JUMPTYPE][14] =
    {
        {740, 780, 820, 860, 900, 960, 1000, 740, 780, 820, 860, 900, 960, 1000}, // 01,TJ/ZD/FG-07K
        {740, 780, 820, 860, 900, 960, 1000, 740, 780, 820, 860, 900, 960, 1000}, // 02,TJ/ZD/FG-09K
        {530, 550, 600, 650, 700, 750, 800, 530, 550, 600, 650, 700, 750, 800},   // 03,TJ/ZD/FG-012K
        {350, 350, 370, 380, 400, 430, 470, 320, 350, 370, 380, 400, 430, 470},   // 04,TJ/ZD/FG-018K
        {550, 600, 650, 750, 800, 850, 900, 550, 600, 650, 750, 800, 850, 900},   // 05,TJ/ZD/FG-022K
        {440, 480, 500, 520, 560, 600, 680, 440, 480, 500, 520, 560, 600, 680},   // 06,TJ/ZD/FG-024K
        {380, 410, 440, 530, 560, 580, 620, 380, 410, 440, 530, 560, 580, 620},   // 07,TJ/ZD/FG-028K
        {380, 410, 440, 530, 560, 580, 620, 380, 410, 440, 530, 560, 580, 620},   // 08,TJ/ZD/FG-030K
        {500, 560, 600, 640, 680, 720, 780, 470, 500, 530, 560, 600, 640, 720},   // 09,TJ/ZD/FG-036K
        {500, 520, 560, 600, 640, 680, 720, 500, 520, 560, 600, 640, 680, 720},   // 10,TJ/ZD/FG-042K
        {560, 600, 600, 640, 680, 720, 780, 500, 560, 600, 640, 680, 720, 780},   // 11,TJ/ZD/FG-048K
        {560, 640, 680, 720, 760, 780, 780, 560, 640, 680, 720, 760, 780, 780},   // 12,TJ/ZD/FG-060K
        {560, 640, 680, 720, 760, 780, 780, 560, 640, 680, 720, 760, 780, 780},   // 13
        {560, 640, 680, 720, 760, 780, 780, 560, 640, 680, 720, 760, 780, 780},   // 14
        {560, 640, 680, 720, 760, 780, 780, 560, 640, 680, 720, 760, 780, 780},   // 15
};

/*** SAVECOOL, HEATNOS, HEATTEST, HEAT1, HEAT2, HEAT3, HEAT4, HEAT5, HEAT6 ***/
const U8 verSwHeatTab[MODEL_NUM][8] =
    {
        {30, 70, 50, 30, 40, 50, 60, 70}, // 9K
        {30, 70, 50, 30, 40, 50, 60, 70}, // 12K
        {30, 70, 50, 30, 40, 50, 60, 70}, // 18K
        {30, 70, 50, 30, 40, 50, 60, 70}, // 24K
};

/*** RESET, COOLNOS, COOLTEST, COOL1, COOL2, COOL3, COOL4, COOL5, COOL6 ***/
const U8 verSwCoolTab[MODEL_NUM][8] =
    {
        {100, 30, 50, 30, 40, 50, 60, 70}, // 9K
        {100, 30, 50, 30, 40, 50, 60, 70}, // 12K
        {100, 30, 50, 30, 40, 50, 60, 70}, // 18k
        {100, 30, 50, 30, 40, 50, 60, 70}, // 18k
};

const U8 horSwTab[MODEL_NUM][6] =
    {
        {95, 3, 19, 35, 59, 83},   // 9K
        {110, 5, 25, 50, 75, 100}, // 12K
        {110, 5, 25, 50, 75, 100}, // 18k
        {110, 5, 25, 50, 75, 100}, // 24K
};
#endif

static ram_byte Select1;
#define selectFlag Select1.byte
#define f_jumpSel1 Select1.bit.b0
#define f_jumpSel2 Select1.bit.b1
#define f_jumpSel3 Select1.bit.b2
#define f_jumpSel4 Select1.bit.b3
#define f_jumpSel5 Select1.bit.b4

static ram_byte Select2;
#define selectFlag1 Select2.byte
#define f_eepRomSel Select2.bit.b0
#define f_inPowerSel Select2.bit.b1
#define f_heatCoolSel Select2.bit.b2
#define f_quickTestSel Select2.bit.b3

static ram_byte Select3;
#define selectFlag2 Select3.byte
#define f_bomaSel1 Select3.bit.b0
#define f_bomaSel2 Select3.bit.b1
#define f_bomaSel3 Select3.bit.b2
#define f_bomaSel4 Select3.bit.b3

#else
#define sysInit_Extern extern
#endif
sysInit_Extern U8 CommInOut_Type1; // 0-美博，1-亚丁
sysInit_Extern U8 CommInOut_Type2; // 0-零火线，1-485
sysInit_Extern U8 Fanmotor_Type;   // 0-直流，1-交流
sysInit_Extern Horsepower MachineHorsepower; //机器P数，分别为1.5P，2P，3P，5P


sysInit_Extern U8 Norm60Fast02;
sysInit_Extern U8 Norm01Fast30;
sysInit_Extern U8 Norm01Fast05;

sysInit_Extern U8 timer_powerOn;

sysInit_Extern U8 jumpType;
sysInit_Extern U8 bomaType;

sysInit_Extern U8 sysAbility;

sysInit_Extern ram_byte Select3;
#define f_eepRom Select3.bit.b0
#define f_inPower Select3.bit.b1
#define f_coldOnly Select3.bit.b2
#define f_quickTest Select3.bit.b3
#define f_selErr Select3.bit.b4
#define f_eepErr Select3.bit.b5

void sysInit(void);
void selJudge(void);
void quickTest(void);
void portReset(void);
void varInit(void);
void abiltySet(void);
void fanSpeedSet(void);
void swingAglSet(void);
U16 swStepJudge(U16);
#endif
